

#pragma once

#include "common/time.h"

#include "config/parameter_group.h"

extern int32_t AltHold;

typedef struct airplaneConfig_s {
    bool fixedwing_althold_reversed;           // false for negative pitch/althold gain. later check if need more than just sign
} airplaneConfig_t;

PG_DECLARE(airplaneConfig_t, airplaneConfig);

void calculateEstimatedAltitude(timeUs_t currentTimeUs);
int32_t getEstimatedAltitude(void);
int32_t getEstimatedVario(void);

void applyAltHold(void);
void updateAltHoldState(void);
void updateSonarAltHoldState(void);
